package recursion;

/**
 * @author czt
 * @version 1.0
 * @since 2024/12/12
 */
public class ReversePrintString {

    public static void main(String[] args) {
        String str = reversePrint("hello");
        System.out.println(str);
    }

    public static String reversePrint(String str) {
        if (str.isEmpty()) {
            return str;
        }

        return reversePrint(str.substring(1)) + str.charAt(0);
    }
}
